﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using ImageProcessing.Utilities;

namespace ImageProcessing.DataEntryDialogs
{
    public partial class TranslateDialog : Form
    {
        Dimentions dimentions;
        public TranslateDialog(ref Dimentions dim)
        {
            InitializeComponent();
            dimentions = dim;
        }

        private void btnTranslate_Click(object sender, EventArgs e)
        {
            try
            {
                if (txtXoffset.Text != string.Empty && txtYoffset.Text != string.Empty)
                {
                    dimentions.Width = int.Parse(this.txtXoffset.Text);
                    dimentions.Height = int.Parse(this.txtYoffset.Text);
                    this.Close();
                }
                else
                {
                    MessageBox.Show("Please fill in required fields.");
                }
            }
            catch (Exception ex)
            {
                Logger.LogException(ex);
                throw;
            }
        }
    }
}
